from dataclasses import dataclass


@dataclass
class Tool:
    name: str
    command: str
    category: str
    icon: str = ""
    description: str = ""
    status: str = "stopped"  # stopped/running/error

    @property
    def display_name(self):
        return f"{self.name} [{self.category}]"

    def to_dict(self):
        return {
            "name": self.name,
            "command": self.command,
            "icon": self.icon,
            "description": self.description
        }


class ToolCategory:
    def __init__(self, name):
        self.name = name
        self.tools = []

    def add_tool(self, tool: Tool):
        self.tools.append(tool)